<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="css/login2.css">
<link href="css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript" src="js/jquery.min.js"></script>
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

    <!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

<title>小米商城首页</title>
</head>
<body>
<%@ include file="header.jsp"%>
<!--网站中间内容开始-->
<div id="thred">
      <img src="image/banner2.jpg" width="1230" height="460" /> 
</div>
   <div id="forth">
   		<span>
        	<a href=""><img src="image/hjh_01.gif" /></a>
            <a href=""><img src="image/hjh_02.gif" /></a>
            <a href=""><img src="image/hjh_03.gif" /></a>
            <a href=""><img src="image/hjh_04.gif" /></a>
            <a href=""><img src="image/hjh_05.gif" /></a>
            <a href=""><img src="image/hjh_06.gif" /></a>
        </span>
        <a href="" id="a_left"><img src="image/hongmi4x.png" width="316" height="170" /></a>
        <a href="" id="a_left"><img src="image/xiaomi5.jpg" width="316" height="170" /></a>
    	<a href="" id="a_left"><img src="image/pinghengche.jpg" width="316" height="170" /></a>
   </div>
   <div id="fifth">
   		<span id="fif_text">小米明星单品</span>
   </div>
    <div id="sixth">
        <c:forEach items="${goods}" var="good">
            <span style="margin-left:20px; border-top:#ffa500 1px solid">
                <a href="${pageContext.request.contextPath }/good?action=showGoodDetail&goodId=${good.id}" id="siximg"><img src="${pageContext.request.contextPath }/${good.goodImg}" width="234" height="234" /></a>
            	<a href="${pageContext.request.contextPath }/good?action=showGoodDetail&goodId=${good.id}" id="na">${good.goodName}</a>
                <p id="chip">${good.goodDesc}</p>
                <p id="pri">${good.goodPrice}元起</p>
            </span>
        </c:forEach>

    </div>
<div style="position: relative;left: 45%;">
    <nav aria-label="...">
        <ul class="pagination">
            <c:if test="${page.pageIndex<=1}">
                <li class="disabled"><a href="${pageContext.request.contextPath}/good?action=getGoodsListByTypeId&typeId=${typeId}&pageIndex=1" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a></li>
            </c:if>
            <c:if test="${page.pageIndex>1}">
                <li><a href="${pageContext.request.contextPath}/good?action=getGoodsListByTypeId&typeId=${typeId}&pageIndex=1" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a></li>
            </c:if>
            <c:forEach begin="1" end="${page.totalPages}" var="i">
                <c:if test="${i==page.pageIndex}">
                    <li class="active"><a href="${pageContext.request.contextPath}/good?action=getGoodsListByTypeId&typeId=${typeId}&pageIndex=${i}">${i} <span class="sr-only">(current)</span></a></li>

                </c:if>
                <c:if test="${i!=page.pageIndex}">
                    <li ><a href="${pageContext.request.contextPath}/good?action=getGoodsListByTypeId&typeId=${typeId}&pageIndex=${i}">${i} <span class="sr-only">(current)</span></a></li>

                </c:if>

            </c:forEach>
            <c:if test="${page.pageIndex>=page.totalPages}">
                <li class="disabled"><a href="${pageContext.request.contextPath}/good?action=getGoodsListByTypeId&typeId=${typeId}&pageIndex=${page.totalPages}" aria-label="Previous"><span aria-hidden="true">&raquo;</span></a></li>
            </c:if>
            <c:if test="${page.pageIndex < page.totalPages}">
                <li><a href="${pageContext.request.contextPath}/good?action=getGoodsListByTypeId&typeId=${typeId}&pageIndex=${page.totalPages}" aria-label="Previous"><span aria-hidden="true">&raquo;</span></a></li>
            </c:if>
        </ul>
    </nav>
</div>

   <!-- 底部 -->
   <%@ include file="footer.jsp"%>
</body>
</html>